package io.kiki.stack.netty.config;

import javax.net.ssl.TrustManagerFactory;

/**
 * Supported options in client side.
 *
 * @author chengyi (mark.lx@antfin.com) 2018-11-06 18:00
 */
public class ClientOption<T> extends GenericOption<T> {

    public static final Option<Integer> netty_io_ratio = valueOf("tcp.heartbeat.interval", 15 * 1000);
    public static final Option<Integer> tcp_idle_maxtimes = valueOf("tcp.heartbeat.maxtimes", 3);

    public static final Option<Integer> Channel_create_tp_min_size = valueOf("Channel.create.tp.min", 3);
    public static final Option<Integer> Channel_create_tp_max_size = valueOf("Channel.create.tp.max", 8);
    public static final Option<Integer> Channel_create_tp_queue_size = valueOf("Channel.create.tp.queue", 50);
    public static final Option<Integer> Channel_create_tp_keepalive_time = valueOf("Channel.create.tp.keepalive", 60);

    public static final Option<Boolean> Channel_reconnect_switch = valueOf("Channel.reconnect", false);
    public static final Option<Boolean> Channel_monitor_switch = valueOf("Channel.monitor", false);

    public static final Option<Boolean> cli_ssl_enable = valueOf("client.ssl.enable", false);
    public static final Option<String> cli_ssl_keystore_type = valueOf("client.ssl.keystore.type", null);
    public static final Option<String> cli_ssl_keystore = valueOf("client.ssl.keystore", null);

    public static final Option<String> cli_ssl_keystore_pass = valueOf("client.ssl.keystore.password", null);
    public static final Option<String> cli_ssl_tmf_algo = valueOf("client.ssl.tmf.algorithm", TrustManagerFactory.getDefaultAlgorithm());

    private ClientOption(String name, T defaultValue) {
        super(name, defaultValue);
    }
}
